package activities;

import baza.Objekti;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import diplomski.osijekinfo.R;

public class Opis extends Activity {
	TextView naslov,adresa,opis;
	Button upute;
	Objekti objekt;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_opis);
		
		Intent intent = getIntent();
        objekt=(Objekti) intent.getSerializableExtra("objekt");
        
        
        adresa= (TextView)findViewById(R.id.opis_adresa);
        opis=(TextView) findViewById(R.id.opis_info);
        
        
        adresa.setText(objekt.getAdresa());
        opis.setText(objekt.getOpis());
        
        upute= (Button) findViewById(R.id.opis_upute);
        upute.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
				Uri.parse("http://maps.google.com/maps?f=d&daddr="+objekt.getKx()+","+objekt.getKy()));
				startActivity(intent);				
			}});
		
	}

}
